package xyz.yiui.dao.user;

import xyz.yiui.pojo.User;
import xyz.yiui.util.Constans;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

public interface UserDao {
    //得到要登录的用户
    public User getLoginUser(Connection connection,String userCode) throws SQLException;
    ///修改当前用户密码
    public int updatePwd(Connection connection,int id,String password) throws SQLException;

    //查询用户总数int
    public int getUserCount(Connection connection,String username,int userRole) throws SQLException;

    ///获取用户列表
    public List<User> getUserList(Connection connection, String userName, int userRole, int currentPageNo, int pageSize)throws Exception;

    ///增加用户
    public int add(Connection connection, User user)throws Exception;
    //删除用户
    public int deleteUserById(Connection connection, Integer delId)throws Exception;
    ///根据id得到用户
    public User getUserById(Connection connection, String id)throws Exception;
    ///更新用户
    public int modify(Connection connection, User user)throws Exception;
    ///通过用户编码查找用户
    public User getUserByCode(Connection connection, String userCode)throws Exception;

}
